import request from '@/utils/request.js'
const api_name = '/user/auth/profile'
export default {
  uploadProfile(file) {
    return request({
      url: api_name + '/uploadProfile',
      method: 'post',
      data: file,
    })
  },
  deleteProfile(imageName) {
    return request({
      url: api_name + '/deleteProfile',
      method: 'post',
      data: imageName,
    })
  },
  updateProfile(userId, imageName) {
    return request({
      url: api_name + '/updateProfile',
      method: 'post',
      params: {
        userId,
        imageName,
      },
    })
  },
  getProfileInfo(userId) {
    return request({
      url: api_name + '/' + userId,
      method: 'get',
    })
  },
  updateHistoryProfile(userId, historyProfile) {
    return request({
      url: api_name + '/updateHistoryProfile/' + userId,
      method: 'post',
      params: {
        userId,
      },
      data: historyProfile,
    })
  },
}
